<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Class</title>
</head>
<body>

</body>
<script>
    //后端 C++ JAVA c# 强类型语音
    //TS  js=>(超集)  TypeScript(js)
    //babel (编译/汇编)  less sass ==> css
    //ES6 ---> ES5
    //VUE--->ES6 ---> ES5
    //VUE(TS)--->ES6 ---> ES5
    //DOM (重绘/回流)

    {
        //Class
        class Person {
            constructor(name) {
                this.name = name;
            }
            getName(){
                console.log(this.name)
            }
        }
        /*class Child {
            constructor(name) {
                this.name = name;
            }
            getName(){
                console.log(this.name)
            }
        }*/
        /*let a = new A();
        //ES6中基于class创造出来的类不能当作普通函数执行
        console.log(a)*/
        //ES6继承
        class Child extends Parent{//extends  ==>  Child.prototype = new Parent()
            constructor(name) { //==> prototype.constructor = new Child;
                super(100);//=> Parent.call(this,100)
                this.name = name;
            }
            getName(){
                console.log(this.name)
            }
        }

    }





</script>
</html>